import json


class Serializable(object):

    def to_dict(self):
        raise NotImplementedError("Object %s method %s is not implemented"%(self.__class__.__name__,"to_dict"))

    def to_json(self):
        return json.dumps(self.to_dict())
